/**
 * 
 */
package com.example.web;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 创建一个Rest Api来返回配置中心的from属性
 */
@RefreshScope
@RestController
public class TestController {
	@Value("${from}")
	private String from;// 通过@Value("${from}")绑定配置服务中配置的from属性。

	@RequestMapping("/from")
	public String from() {
		return this.from;
	}
}
